package com.eleven.trades.error;


public class BusinessException  extends  Exception implements  CommonError{
    private CommonError commonError;

    //直接接收EmBusinessError的传参用于构造业务异常
    public BusinessException( CommonError commonError) {
        super();
        this.commonError = commonError;
    }

    public BusinessException(CommonError commonError,String message) {
        super();
        this.commonError = commonError;
        this.commonError.setMessage(message);
    }

    @Override
    public Integer getCode() {

        return this.commonError.getCode();
    }

    @Override
    public String getMessage() {

        return this.commonError.getMessage();
    }

    @Override
    public void setMessage(String errMsg) {
        this.commonError.setMessage(errMsg);
    }
}
